* the bundles, first for PostCard then PaintDisplay
Type BNDL
,128
PCRD 0
ICN#
0 128
FREF
0 128
* this BNDL will be renumbered by the application
,129
PDIS 0
ICN#
0 128
FREF
0 128
* we'll use the same FREF for both
Type FREF
,128
APPL 0
* PostCard file type
Type PCRD = STR
,0
PostCard Version 1.0 - 12 Oct 87
* PaintDISplay file type
Type PDIS = STR
,0
PaintDisplay Version 1.0 - 12 Oct 87
* der menu
Type MENU
,1
\14
About PostCard...
(-
,255
File
Quit
,256
Commands
Make a PostCard...
(-
Help...
* now the application icon
Type ICN# = GNRL
,128
.H
00000000
00000000
1FFFF800
20003C00
20007C00
27FFFC00
2401FC00
2553FC00
2402F400
2545E400
2409C400
25428400
24010400
25420400
24003F00
25084080
24108040
23F13020
2039C814
201E7F8F
20023007
261F0007
26008007
20006007
3FFFFFE7
2000021F
1FFFFC07
00000000
00000000
00000000
00000000
00000000
* next the mask
00000000
00000000
1FFFF800
3FFFFC00
3FFFFC00
3FFFFC00
3FFFFC00
3FFFFC00
3FFFFC00
3FFFFC00
3FFFFC00
3FFFFC00
3FFFFC00
3FFFFC00
3FFFFF00
3FFFFF80
3FFFFFC0
3FFFFFE0
3FFFFFF4
3FFFFFFF
3FFFFFFF
3FFFFFFF
3FFFFFFF
3FFFFFFF
3FFFFFFF
3FFFFE1F
1FFFFC07
00000000
00000000
00000000
00000000
00000000
* now the stand alone file's icon
,129
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
FFFFFFFF
81D00001
81D000FD
81F000AD
811000D5
811000AD
811000D5
811000FD
81100001
80E00001
81F00001
81F00001
81F80001
81F80001
81E85FFF
81F80BFF
80D03FFF
80F0FFFF
80703FFF
8019FFFF
80000001
FFFFFFFF
00000000
* next the mask
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
FFFFFFFF
00000000
* the dialog items
Type DITL
,255 (4)
2
button
48 272 66 349
OK
staticText Disabled
6 11 43 350
^0
,256 (4)
5
button
171 86 190 178
OK
staticText Disabled
2 86 20 177
PostCard 1.0
staticText Disabled
24 13 87 263
PostCard creates an application and then places a Paint file into the data fork, thus creating a stand alone viewer.
staticText Disabled
124 24 158 241
Copyright 1987, Joel McNamara\0D All Rights Reserved
staticText Disabled
100 50 118 208
for MacTutor Magazine
,257 (4)
4
button
166 295 184 406
OK
staticText Disabled
3 4 38 423
PostCard takes a MacPaint document and turns it into a stand alone application that displays the upper left corner.
staticText Disabled
42 4 91 423
When the Paint document is selected a new file is created with CODE resources (FAKE and DUMY - stored within the PostCard application) copied and renamed into the new file.
staticText Disabled
95 4 161 423
These resources drive the new application by reading its own data fork (copied in from the Paint file) and then displaying the bit mapped image.
* the dialogs
Type DLOG
,255 (4)
message
60 68 136 438
Visible NoGoAway
1
0
255
,256 (4)
about
52 122 252 394
Visible NoGoAway
1
0
256
,257 (4)
help
46 48 242 474
Visible NoGoAway
1
0
257
* here's the trickery - we create new resources of type FAKE, and read
* the CODE resources from PaintDisplay into them.
Type FAKE = GNRL
,0
.R
Development:MacTutor:PaintDisplay CODE 0
* you'll need to specify a different pathname above
,1
.R
Development:MacTutor:PaintDisplay CODE 1
* you'll need to specify a different pathname above
,2
.R
Development:MacTutor:PaintDisplay CODE 2
* you'll need to specify a different pathname above
* now get the rest of the resources we need (as required by Lightspeed C) -
* creating dummy resources named DUMY.
Type DUMY = GNRL
,0
.R
Development:MacTutor:PaintDisplay CREL 2
* you'll need to specify a different pathname above
,1
.R
Development:MacTutor:PaintDisplay DATA 0
* you'll need to specify a different pathname above
,2
.R
Development:MacTutor:PaintDisplay DREL 0
* you'll need to specify a different pathname above
,3
.R
Development:MacTutor:PaintDisplay STRS 0
* you'll need to specify a different pathname above
,4
.R
Development:MacTutor:PaintDisplay ZERO 0
* you'll need to specify a different pathname above